﻿package Welsy4.Connect.vo
{
	
	/**
	 * ...
	 * @author DefaultUser (Tools -> Custom Arguments...)
	 */
	public class Meeting implements IMeeting
	{
		public var sco_id:String;
		public var type:String;
		public var icon:String;
		public var permissionid:String;
		public var active_participants:String;
		
		public var name:String;
		public var domain_name:String;
		public var url_path:String;
		public var date_begin:String;
		public var date_end:String;
		public var expired:Boolean;
		public var duration:String;
	    
		public var description:String;
		
		public function Meeting() {
		
		}
		
		public function set Description(description: String):void {
			this.description = description;
		}
		
		public function set Duration(duration: String):void {
			this.duration = duration;
		}
		
		public function set Name(name:String):void {
		    this.name = name;
		}
		
		public function set Date_begin(date_begin:Date):void {
		    this.date_begin = Calendar.getAdobeConnectDate(date_begin);
		}
		public function set Date_end(date_end:Date):void {
		    this.date_end = Calendar.getAdobeConnectDate(date_end);
		}
		
		public function setMeeting( xml:XML):void {
			
			this.sco_id = (xml.attribute("sco-id"));
			this.type = xml.@type;
			this.icon = xml.@icon;
			this.permissionid = xml.@permissionid;
			this.active_participants = xml.attribute("active-participants");
			
			this.name = xml.name;
			this.domain_name = xml.elements("domain-name");
			this.url_path = xml.elements("url-path");
			this.date_begin = xml.elements("date-begin");
			this.date_end = xml.elements("date-end");
			this.expired = Boolean(xml.expired);
			this.duration = xml.duration;
		}
		
		public function getURL():String {
		    return "https://" + this.domain_name + this.url_path;	
		}
		
		
		
	}
	
}